window.addEventListener('load',function () {
    var lis =  document.querySelector('.xuanzechima').querySelectorAll('li');
for (var i = 0 ;i < lis.length; i++)  {
    lis[i].onclick = function () {
        // 派他思想
        for (var i = 0 ; i < lis.length; i++) {
            lis[i].style.backgroundColor = 'rgb(255, 255, 255)' ;
        }
        this.style.backgroundColor = 'pink';
    }
}


// 弹出已加入购物车页面
    var add_car = document.querySelector('.add_car');
    var login = document.querySelector('.login');
    var reg_form = document.querySelector('.reg_form');
    var guanbi = document.querySelector('.guanbi');
    add_car.addEventListener('click',function () {
        login.style.visibility= 'visible';
        login.style.opacity= 1;
        reg_form.style.opacity= 1;
        reg_form.style.transform= 'translateY(0)';
    });
    guanbi.addEventListener('click',function () {
        login.style.visibility= 'hidden';
        login.style.opacity= 0;
        reg_form.style.opacity= 0;
        reg_form.style.transform= 'translateY(30px)';
    })
})